#ifndef QTEMPLATEDIALOG_H
#define QTEMPLATEDIALOG_H

#include <QDialog>
#include <QMap>

namespace Ui {
class QTemplateDialog;
}

namespace SHAREDLIB
{
    class QNameEdit;
}
class QTemplateTreeWidget;
struct tagTemplateInfo;
class QTemplateDialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit QTemplateDialog(const QString& type,QWidget *parent = 0);
    ~QTemplateDialog();

    QString get_name();
    QString get_template_name();
protected slots:
    void select(tagTemplateInfo *info);
private slots:
    void on_exists_button_clicked();
    void remove(const QString &path);
    void changed(const QString &old,const QString& now);
    void on_okbtn_clicked();

    void on_cancelbtn_clicked();

private:
    Ui::QTemplateDialog *ui;
    SHAREDLIB::QNameEdit  *m_nameEdit;
    QTemplateTreeWidget     *m_treelist;
    QMap<QString,QPixmap>      m_images;

    tagTemplateInfo         *m_templateInfo;
    QString                 m_type;
    QString                 m_name;
    QString                 m_template_name;
};

#endif // QTEMPLATEDIALOG_H
